create database Artice
use Artice

create table Account
(
	Id int primary key identity(100001,1),
	Password varchar(30) not null,
	Mail nvarchar(50) not null,
	RegisterTime varchar(20) not null,
	Level int not null
)

create table UserInfo
(
	Id int primary key,
	Avatar varchar(50) not null,
	NickName varchar(20) not null
)

insert into Account values('123456','2448546634@qq.com','20210101000000000',0)
declare @name int = (select top 1 Id from Account where RegisterTime = '20210101000000000')
insert into UserInfo values(@name,'defalut.jpg','SanYing')

select * from Account right join UserInfo on Account.Id = UserInfo.Id

create table Report
(
	Id int primary key identity(100001,1),
	WhistleblowerId int not null,
	_WhistleblowerId int not null,
	Time varchar(20) not null,
	Reason varchar(1024) not null,
	Status int not null,
	AdminId varchar(50) not null
)

create table ArticleList
(
	Id int primary key identity(100001,1),
	ReleaseId int not null,
	Time varchar(20) not null,
	Title varchar(256) not null,
	Text text not null,
	Classification int not null,
	IsPublic bit not null default(1),
	IsComment bit not null default(1),
	IsAllow bit not null default(0)
)

select * from ArticleList

create table Message
(
	Id int primary key identity(100001,1),
	SendAdminId varchar(30) not null,
	_SendAdminId int not null,
	Title varchar(50) not null,
	Text varchar(1024) not null,
	Time varchar(20) not null,
	IsRead bit not null default(0)
)

create table Administrator
(
	Id int primary key identity,
	Number varchar(30) not null,
	Password varchar(30) not null
)